home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / fragrouter / Libnet-0.99b / include / libnet / libnet-functions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-07-26  |  19.5 KB  |  736 lines

  1. /*
  2.  *  $Id: libnet-functions.h,v 1.2 1999/05/27 02:32:18 dugsong Exp $
  3.  *
  4.  *  libnet-functions.h - Network routine library function prototype header file
  5.  *
  6.  *  Copyright (c) 1998, 1999 Mike D. Schiffman <mike@infonexus.com>
  7.  *                           route|daemon9 <route@infonexus.com>
  8.  *  All rights reserved.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  *
  19.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  20.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  23.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29.  * SUCH DAMAGE.
  30.  *
  31.  */
  32.  
  33. #ifndef __LIBNET_FUNCTIONS_H
  34. #define __LIBNET_FUNCTIONS_H
  35.  
  36. /*
  37.  *  Seeds the pseudorandom number generator with gettimeofday.
  38.  */
  39.  
  40. int
  41. seed_prand();
  42.  
  43.  
  44. /*
  45.  *  Returns a psuedorandom positive integer.
  46.  */
  47.  
  48. u_long
  49. get_prand(
  50.     int                 /* One of the PR* constants */
  51.     );
  52.  
  53.  
  54. /*
  55.  *  Calculates IPv4 family checksum on packet headers.
  56.  */
  57.  
  58. int                     /* 1 on success, -1 on failure */
  59. do_checksum(
  60.     u_char *,           /* Pointer to the packet buffer */
  61.     int,                /* Protocol */
  62.     int                 /* Packet size */
  63.     );
  64.  
  65.  
  66. /*
  67.  *  Network byte order into IP address
  68.  *  Previous versions had a memory leak (returned a strdup'd pointer -- strdup
  69.  *  has an implicit malloc which wasn't getting freed).  This static var hack
  70.  *  thingy was used to preserve existing code without having to change much.
  71.  *  You can simply use the return value of the function directly allowing you
  72.  *  to write tighter, more obvious code (rather then having to do allocate an
  73.  *  additional buffer for the output).
  74.  *  Thanks to Red for the idea.
  75.  */
  76.  
  77. u_char *                /* Pointer to hostname or dotted decimal IP address */
  78. host_lookup(
  79.     u_long,             /* Network byte ordered (big endian) IP address */
  80.     u_short             /* Use domain names or no */
  81.     );
  82.  
  83.  
  84. /*
  85.  *  Network byte order into IP address
  86.  *  Threadsafe version.
  87.  */
  88.  
  89. void
  90. host_lookup_r(
  91.     u_long,             /* Network byte ordered (big endian) IP address */
  92.     u_short,            /* Use domain names or no */
  93.     u_char *            /* Pointer to hostname or dotted decimal IP address */
  94.     );
  95.  
  96.  
  97. /*
  98.  *  IP address into network byte order
  99.  */
  100.  
  101. u_long                  /* Network byte ordered IP address or -1 on error */
  102. name_resolve(
  103.     u_char *,           /* Pointer the hostname or dotted decimal IP address */
  104.     u_short             /* Use domain names or no */
  105.     );
  106.  
  107.  
  108. /*
  109.  *  Fast x86 TCP checksum.  This function builds it's own psuedoheader.
  110.  */
  111.  
  112. u_short                 /* Standard TCP checksum of header and data */
  113. tcp_check(
  114.     struct tcphdr *,    /* TCP header pointer */
  115.     int,                /* Packet length */
  116.     u_long,             /* Source IP address */
  117.     u_long              /* Destination IP address */
  118.     );
  119.  
  120.  
  121. /*
  122.  *  Fast x86 IP checksum.
  123.  */
  124.  
  125. u_short                 /* Standard IP checksum of header and data */
  126. ip_check(
  127.     u_short *,          /* Pointer to the buffer to be summed */
  128.     int                 /* Packet length */
  129.     );
  130.  
  131.  
  132. /*
  133.  *  Opens a socket for writing raw IP datagrams to.  Set IP_HDRINCL to let the 
  134.  *  kernel know we've got it all under control.
  135.  */
  136.  
  137. int                     /* Opened file desciptor, or -1 on error */
  138. open_raw_sock(
  139.     int                 /* Protocol of raw socket (from /etc/protocols) */
  140.     );
  141.  
  142.  
  143. int                     /* 1 upon success, or -1 on error */
  144. close_raw_sock(
  145.     int                 /* File descriptor */
  146.     );
  147.  
  148.  
  149. int
  150. libnet_select_device(
  151.     struct sockaddr_in *sin,
  152.     u_char **device,
  153.     u_char *ebuf
  154.     );
  155.  
  156. /*
  157.  *  Ethernet packet assembler.
  158.  */
  159.  
  160. void
  161. build_ethernet(
  162.     u_char *,           /* Pointer to a 6 byte ethernet address */
  163.     u_char *,           /* Pointer to a 6 byte ethernet address */
  164.     u_short,            /* Packet IP type */
  165.     const u_char *,     /* Payload (or NULL) */
  166.     int,                /* Payload size */
  167.     u_char *            /* Packet header buffer */
  168.     );
  169.  
  170.  
  171. /*
  172.  *  ARP packet assembler.
  173.  */
  174.  
  175. void
  176. build_arp(
  177.     u_short,            /* hardware address type */
  178.     u_short,            /* protocol address type */
  179.     u_char,             /* hardware address length */
  180.     u_char,             /* protocol address length */
  181.     u_short,            /* ARP operation type */
  182.     u_char *,           /* sender hardware address */
  183.     u_char *,           /* sender protocol address */
  184.     u_char *,           /* target hardware address */
  185.     u_char *,           /* target protocol address */
  186.     const u_char *,     /* payload or NULL if none */
  187.     int,                /* payload length */
  188.     u_char *            /* packet buffer memory */
  189.     );
  190.  
  191. /*
  192.  *  TCP packet assembler.
  193.  */
  194.  
  195. void
  196. build_tcp(
  197.     u_short,            /* Source port */
  198.     u_short,            /* Destination port */
  199.     u_long,             /* Sequence Number */
  200.     u_long,             /* Acknowledgement Number */
  201.     u_char,             /* Control bits */
  202.     u_short,            /* Advertised Window Size */
  203.     u_short,            /* Urgent Pointer */
  204.     const u_char *,     /* Pointer to packet data (or NULL) */
  205.     int,                /* Packet payload size */
  206.     u_char *            /* Pointer to packet header memory */
  207.     );
  208.  
  209.  
  210. /*
  211.  * UDP packet assembler.
  212.  */
  213.  
  214. void
  215. build_udp(
  216.     u_short,            /* Source port */
  217.     u_short,            /* Destination port */
  218.     const u_char *,     /* Pointer to packet data (or NULL) */
  219.     int,                /* Packet payload size */
  220.     u_char *            /* Pointer to packet header memory */
  221.     );
  222.  
  223. /*
  224.  *  ICMP_ECHO packet assembler.
  225.  */
  226.  
  227. void
  228. build_icmp_echo(
  229.     u_char,             /* icmp type */
  230.     u_char,             /* icmp code */
  231.     u_short,            /* id */
  232.     u_short,            /* sequence number */
  233.     const u_char *,     /* Pointer to packet data (or NULL) */
  234.     int,                /* Packet payload size */
  235.     u_char *            /* Pointer to packet header memory */
  236.     );
  237.  
  238. /*
  239.  *  ICMP_MASK packet assembler.
  240.  */
  241.  
  242. void
  243. build_icmp_mask(
  244.     u_char,             /* icmp type */
  245.     u_char,             /* icmp code */
  246.     u_short,            /* id */
  247.     u_short,            /* sequence number */
  248.     u_long,             /* address mask */
  249.     const u_char *,     /* Pointer to packet data (or NULL) */
  250.     int,                /* Packet payload size */
  251.     u_char *            /* Pointer to packet header memory */
  252.     );
  253.  
  254.  
  255. /*
  256.  *  ICMP_UNREACH packet assembler.
  257.  */
  258.  
  259. void
  260. build_icmp_unreach(
  261.     u_char,             /* icmp type */
  262.     u_char,             /* icmp code */
  263.     u_short,            /* Original Length of packet data */
  264.     u_char,             /* Original IP tos */
  265.     u_short,            /* Original IP ID */
  266.     u_short,            /* Original Fragmentation flags and offset */
  267.     u_char,             /* Original TTL */
  268.     u_char,             /* Original Protocol */
  269.     u_long,             /* Original Source IP Address */
  270.     u_long,             /* Original Destination IP Address */
  271.     const u_char *,     /* Pointer to original packet data (or NULL) */
  272.     int,                /* Packet payload size (or 0) */
  273.     u_char *            /* Pointer to packet header memory */
  274.     );
  275.  
  276.  
  277. /*
  278.  *  ICMP_UNREACH packet assembler.
  279.  */
  280.  
  281. void
  282. build_icmp_timeexceed(
  283.     u_char,             /* icmp type */
  284.     u_char,             /* icmp code */
  285.     u_short,            /* Original Length of packet data */
  286.     u_char,             /* Original IP tos */
  287.     u_short,            /* Original IP ID */
  288.     u_short,            /* Original Fragmentation flags and offset */
  289.     u_char,             /* Original TTL */
  290.     u_char,             /* Original Protocol */
  291.     u_long,             /* Original Source IP Address */
  292.     u_long,             /* Original Destination IP Address */
  293.     const u_char *,     /* Pointer to original packet data (or NULL) */
  294.     int,                /* Packet payload size (or 0) */
  295.     u_char *            /* Pointer to packet header memory */
  296.     );
  297.  
  298. /*
  299.  *  ICMP_TIMESTAMP packet assembler.
  300.  */
  301.  
  302. void
  303. build_icmp_timestamp(
  304.     u_char,             /* icmp type */
  305.     u_char,             /* icmp code */
  306.     u_short,            /* id */
  307.     u_short,            /* sequence number */
  308.     n_time,             /* original timestamp */
  309.     n_time,             /* receive timestamp */
  310.     n_time,             /* transmit timestamp */
  311.     const u_char *,     /* Pointer to packet data (or NULL) */
  312.     int,                /* Packet payload size */
  313.     u_char *            /* Pointer to packet header memory */
  314.     );
  315.  
  316. /*
  317.  *  IGMP packet builder.
  318.  */
  319.  
  320. void
  321. build_igmp(
  322.     u_char,             /* igmp type */
  323.     u_char,             /* igmp code */
  324.     u_long,             /* ip addr */
  325.     u_char *            /* Pointer to packet header memory */
  326.     );
  327.  
  328.  
  329. /*
  330.  *  IP packet assembler.
  331.  */
  332.  
  333. void
  334. build_ip(
  335.     u_short,            /* Length of packet data */
  336.     u_char,             /* IP tos */
  337.     u_short,            /* IP ID */
  338.     u_short,            /* Fragmentation flags and offset */
  339.     u_char,             /* TTL */
  340.     u_char,             /* Protocol */
  341.     u_long,             /* Source IP Address */
  342.     u_long,             /* Destination IP Address */
  343.     const u_char *,     /* Pointer to packet data (or NULL) */
  344.     int,                /* Packet payload size */
  345.     u_char *            /* Pointer to packet header memory */
  346.     );
  347.  
  348.  
  349. void
  350. build_dns(
  351.     u_short,            /* Packet ID */
  352.     u_short,            /* Flags */
  353.     u_short,            /* Number of questions */
  354.     u_short,            /* Number of answer resource records */
  355.     u_short,            /* Number of authority resource records */
  356.     u_short,            /* Number of additional resource records */
  357.     const u_char *,     /* Payload (or NULL) */
  358.     int,                /* Payload size */
  359.     u_char *            /* Header memory */
  360.     );
  361.  
  362.  
  363. void
  364. build_rip(
  365.     u_char,             /* Command */
  366.     u_char,             /* Version */
  367.     u_short,            /* Zero (v1) or Routing Domain (v2) */
  368.     u_short,            /* Address family */
  369.     u_short,            /* Zero (v1) or Route Tag (v2) */
  370.     u_long,             /* IP address */
  371.     u_long,             /* Zero (v1) or Subnet Mask (v2) */
  372.     u_long,             /* Zero (v1) or Next hop IP address (v2) */
  373.     u_long,             /* Metric */
  374.     const u_char *,     /* Payload (or NULL) */
  375.     int,                /* Payload size */
  376.     u_char *            /* Header memory */
  377.     );
  378.  
  379.  
  380. /*
  381.  *  Insert IP options to a prebuilt IP packet.
  382.  */
  383.  
  384. int                     /* 1 on success, -1 on failure */
  385. insert_ipo(
  386.     struct ipoption *,  /* Pointer to the ip options structure */ 
  387.     u_char,             /* IP option list size */
  388.     u_char *            /* Pointer to packet buf */
  389.     );
  390.  
  391. /*
  392.  *  Insert TCP options to a prebuilt IP packet.
  393.  */
  394.  
  395. int                     /* 1 on success, -1 on failure */
  396. insert_tcpo(
  397.     struct tcpoption *, /* Pointer to the tcp options structure */ 
  398.     u_char,             /* TCP option list size */
  399.     u_char *            /* Pointer to packet buf */
  400.     );
  401.  
  402. /*
  403.  *  Writes a prebuild IP packet to the network with a supplied raw socket.
  404.  *  To write a link layer packet, use the write_link_layer function.
  405.  */
  406.  
  407. int                     /* number of bytes written if successful, -1 on error */
  408. write_ip(
  409.     int sock,           /* Previously opened raw socket */
  410.     u_char *,           /* Pointer a complete IP datagram */
  411.     int                 /* Packet size */
  412.     );
  413.  
  414. /*
  415.  *  Writes a prebuild IP/ethernet packet to the network with a supplied
  416.  *  link_layer interface.  To write just an IP packet, use the write_link_layer
  417.  *  function.
  418.  */
  419.  
  420. int                     /* number of bytes written if successful, -1 on error */
  421. write_link_layer(
  422.     struct link_int *,  /* Pointer to a link interface structure */
  423.     const u_char *,     /* Pointer to the device */
  424.     u_char *,           /* Pointer the u_char buf (the packet)to be written */
  425.     int                 /* Packet length */
  426.     );
  427.  
  428.  
  429. /*
  430.  *  Opens a link layer interface.  Analogous to open_raw_sock.
  431.  */
  432.  
  433. struct link_int *       /* Pointer to a link layer interface struct */
  434. open_link_interface(
  435.     char *,             /* Device name */
  436.     char *              /* Error buffer */
  437.     );
  438.  
  439.  
  440. int                     /* 1 on success, -1 on failure */
  441. close_link_interface(
  442.     struct link_int *   /* Pointer to a link layer interface struct */
  443.     );
  444.  
  445.  
  446. char *                  /* String error message */
  447. ll_strerror(
  448.     int                 /* Errno */
  449.     );
  450.  
  451.  
  452. /*
  453.  *  Returns the IP address of the interface.
  454.  */
  455.  
  456. u_long                  /* 0 upon error, address upon success */
  457. get_ipaddr(
  458.     struct link_int *,  /* Pointer to a link interface structure */
  459.     const u_char *,     /* Device */
  460.     char *              /* Error buf */
  461.     );
  462.  
  463.  
  464. /*
  465.  *  Returns the MAC address of the interface.
  466.  */
  467.  
  468. struct ether_addr *     /* 0 upon error, address upon success */
  469. get_hwaddr(
  470.     struct link_int *,  /* Pointer to a link interface structure */
  471.     const u_char *,     /* Device */
  472.     char *              /* Error buf */
  473.     );
  474.  
  475.  
  476. /*
  477.  *  Simple interface for initializing a packet.
  478.  *  Basically a malloc wrapper.  
  479.  */
  480.  
  481. int                         /* -1 on error, 1 on ok */
  482. init_packet(
  483.     size_t,                 /* 0 and we make a good guess, otherwise you choose. */
  484.     u_char **               /* Pointer to the pointer to the packet */
  485.     );      
  486.  
  487.  
  488. /*
  489.  *  Simple interface for destoying a packet.
  490.  *  Don't call this without a corresponding call to init_packet() first.
  491.  */
  492.  
  493. void
  494. destroy_packet(
  495.     u_char **               /* Pointer to the packet addr. */
  496.     );
  497.  
  498.  
  499. /*
  500.  *  Memory pool initialization routine.
  501.  */
  502.  
  503. int
  504. init_packet_arena(
  505.     struct libnet_arena **, /* Pointer to an arena pointer */
  506.     u_short,
  507.     u_short
  508.     );
  509.  
  510.  
  511. /*
  512.  *  Returns the next chunk of memory from the pool.
  513.  */
  514.  
  515. u_char *
  516. next_packet_from_arena(
  517.     struct libnet_arena **, /* Pointer to an arena pointer */
  518.     u_short
  519.     );
  520.  
  521.  
  522. /*
  523.  *  Memory pool destructor routine.
  524.  */
  525.  
  526. void
  527. destroy_packet_arena(
  528.     struct libnet_arena **  /* Pointer to an arena pointer */
  529.     );
  530.  
  531.  
  532. /* 
  533.  *  More or less taken from tcpdump code.
  534.  */
  535.  
  536. void
  537. libnet_hex_dump(
  538.     u_char *,               /* Packet to be dumped */
  539.     int,                    /* Packet size (in bytes */
  540.     int,                    /* To swap or not to swap */
  541.     FILE *                  /* Stream pointer to dump to */
  542.     );
  543.  
  544. #if (RAW_IS_COOKED)
  545. /*
  546.  * Gets IP of the local interface corresponding to a destination IP.
  547.  */
  548.  
  549. u_long
  550. libnet_get_interface_by_dest(
  551.     u_long ,               /* Destination IP */
  552.     char *                 /* Error buffer */
  553.     );
  554.  
  555. /*
  556.  *  Writes a prebuilt IP packet to the network using the link layer API.
  557.  */
  558.  
  559. int                     /* number of bytes written if successful, -1 on error */
  560. write_ip_via_datalink(
  561.     u_char *,           /* Pointer to complete IP datagram */
  562.     int                 /* Packet size */
  563.     );
  564.  
  565. /*
  566.  *  Selects a device given an IP that corresponds to it.
  567.  */
  568.  
  569. int
  570. libnet_select_device_by_ip(
  571.     u_char **,          /* Pointer to character * to place device name */
  572.     u_long ,            /* IP address of desired interface */
  573.     u_char *            /* Error buffer */
  574.     );
  575.  
  576. /*
  577.  *  Queries the ARP cache for an IP address resolution.
  578.  */
  579.  
  580. int
  581. libnet_query_arp(
  582.     u_long,             /* IP address */
  583.     char *,             /* pointer to place to put hardware address */
  584.     char *              /* Error buffer */
  585.     );
  586.  
  587. int
  588. libnet_active_query_arp(
  589.     u_long,             /* IP address */
  590.     char *,             /* pointer to place to put hardware address */
  591.     u_char *,           /* device to query on */
  592.     char *              /* Error buffer */
  593.     );
  594.  
  595. u_long
  596. libnet_get_next_hop(
  597.     u_long ,            /* Destination IP */
  598.     char *              /* Error buffer */
  599.     );
  600. #endif /* RAW_IS_COOKED */
  601.  
  602. /* STUB MACROS / FUNCTION PROTOTYPES */
  603.  
  604. int
  605. libnet_seed_prand();
  606.  
  607. u_long
  608. libnet_get_prand(int);
  609.  
  610. int
  611. libnet_do_checksum(u_char *, int, int);
  612.  
  613. u_short
  614. libnet_tcp_check(struct tcphdr *, int, u_long, u_long);
  615.  
  616. u_short
  617. libnet_ip_check(u_short *, int);
  618.  
  619.  
  620. u_char *
  621. libnet_host_lookup(u_long, u_short);
  622.  
  623. void
  624. libnet_host_lookup_r(u_long, u_short, u_char *);
  625.  
  626. u_long
  627. libnet_name_resolve(u_char *, u_short);
  628.  
  629. u_short
  630. libnet_tcp_check(struct tcphdr *, int, u_long, u_long);
  631.  
  632. u_short
  633. libnet_ip_check(u_short *, int);
  634.  
  635. int
  636. libnet_open_raw_sock(int);
  637.  
  638. int
  639. libnet_close_raw_sock(int);
  640.  
  641. void
  642. libnet_build_ethernet(u_char *, u_char *, u_short, const u_char *, int,
  643.         u_char *);
  644.  
  645. void
  646. libnet_build_arp(u_short, u_short, u_char, u_char, u_short, u_char *,
  647.         u_char *, u_char *, u_char *, const u_char *, int, u_char *);
  648.  
  649. void
  650. libnet_build_tcp(u_short, u_short, u_long, u_long, u_char, u_short, u_short,
  651.          const u_char *, int, u_char *);
  652.  
  653. void
  654. libnet_build_udp(u_short, u_short, const u_char *, int, u_char *);
  655.  
  656. void
  657. libnet_build_icmp_echo(u_char, u_char, u_short, u_short, const u_char *, int,
  658.         u_char *);
  659.  
  660. void
  661. libnet_build_icmp_mask(u_char,u_char, u_short, u_short, u_long,
  662.         const u_char *, int, u_char *);
  663.  
  664. void
  665. libnet_build_icmp_unreach(u_char, u_char, u_short, u_char, u_short, u_short,
  666.         u_char, u_char, u_long, u_long, const u_char *, int, u_char *);
  667.  
  668. void
  669. libnet_build_icmp_timeexceed(u_char, u_char, u_short, u_char, u_short, u_short, 
  670.         u_char, u_char, u_long, u_long, const u_char *, int, u_char *);
  671.  
  672. void
  673. libnet_build_icmp_timestamp(u_char, u_char, u_short, u_short, n_time, n_time,
  674.         n_time, const u_char *, int, u_char *);
  675.  
  676. void
  677. libnet_build_igmp(u_char, u_char, u_long, u_char *);
  678.  
  679. void
  680. libnet_build_ip(u_short, u_char, u_short, u_short, u_char, u_char, u_long,
  681.         u_long, const u_char *, int, u_char *);
  682.  
  683. void
  684. libnet_build_dns(u_short, u_short, u_short, u_short, u_short, u_short,
  685.         const u_char *, int, u_char *);
  686.  
  687. void
  688. libnet_build_rip(u_char, u_char, u_short, u_short, u_short, u_long, u_long,
  689.         u_long, u_long, const u_char *, int, u_char *);
  690.  
  691. int
  692. libnet_insert_ipo(struct ipoption *, u_char, u_char *);
  693.  
  694. int
  695. libnet_insert_tcpo(struct tcpoption *, u_char, u_char *);
  696.  
  697. int
  698. libnet_write_ip(int sock, u_char *, int);
  699.  
  700. int
  701. libnet_write_link_layer(struct link_int *, const u_char *, u_char *, int);
  702.  
  703. struct link_int *
  704. libnet_open_link_interface(char *, char *);
  705.  
  706. int
  707. libnet_close_link_interface(struct link_int *);
  708.  
  709. char *
  710. libnet_ll_strerror(int);
  711.  
  712. u_long
  713. libnet_get_ipaddr(struct link_int *, const u_char *, u_char *);
  714.  
  715. struct ether_addr *
  716. libnet_get_hwaddr(struct link_int *, const u_char *, u_char *);
  717.  
  718. int
  719. libnet_init_packet(size_t, u_char **);      
  720.  
  721. void
  722. libnet_destroy_packet(u_char **);
  723.  
  724. int
  725. libnet_init_packet_arena(struct libnet_arena **, u_short, u_short);
  726.  
  727. u_char *
  728. libnet_next_packet_from_arena(struct libnet_arena **, u_short);
  729.  
  730. void
  731. libnet_destroy_packet_arena(struct libnet_arena **);
  732.  
  733. #endif  /* __LIBNET_FUNCTIONS_H */
  734.  
  735. /* EOF */
  736.